import random
if __name__ == '__main__':
    print("欢迎来到猜数字游戏")
    guess = int(input('输入你要猜的数字'))
    if guess > 0:
            num = random.randint(1, 100)  # 生成1-100的随机整数
            while guess > 0:
                if guess == num:
                    print("恭喜你猜对了！")
                    break
                elif guess <= num:
                    print("猜小了！")
                    guess = int(input('输入你要猜的数字'))
                elif guess >= num:
                    print("猜大了")
                    guess = int(input('输入你要猜的数字'))
            else:
             print ("输入不能为 0")

